home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / make / icmake-6.000 / icmake-6 / icmake / exec / inlist.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-02-08  |  622 b   |  32 lines

  1. /*
  2. \funcref{inlist}{int inlist (\params)}
  3.     {
  4.         {VAR\_} {v} {variable holding list}
  5.         {char} {*s} {string to search for}
  6.     }
  7.     {0: string not in list, otherwise: string present in list}
  8.     {}
  9.     {copylist(), addtolist()}
  10.     {inlist.c}
  11.     {
  12.         This function checks if a string {\em s} is present in the list
  13.         contained in variable {\em v}.
  14.     }
  15. */
  16.  
  17. #include "icm-exec.h"
  18.  
  19. int inlist (v, s)
  20. VAR_ v;
  21. char *s;
  22. {
  23.     register unsigned
  24.         i;
  25.  
  26.     for (i = 0; i < v.vu.i->ls.list.size; i++)
  27.         if (! strcmp (v.vu.i->ls.list.element [i], s))
  28.             return (1);
  29.  
  30.     return (0);
  31. }
  32.